<?php

namespace app\common\validate;

use think\Validate;
class User extends Validate
{
    protected $rule =   [
        'username'  => 'require',
        'password'   => 'require|min:6',
        'email' => 'require|email|unique:user',
    ];

    protected $message  =   [
        'username.require' => '账号不能为空',
        'password.require' => '密码不能为空',
        'password.min'     => '密码最少6位',
        'email.require' =>"邮箱不能为空",
        'email.email'        => '邮箱格式错误',
        'email.unique'        => '该邮箱已存在',
    ];
    protected $scene = [
        'rePassword'=>['pwd','repwd'],
       'reg'  =>  ['email','pwd','repwd'],
        "login" => ["username","password"]
    ];
}